import BaseService from '@/service/BaseService'
/**
 * 描述:表单服务
 */
class DevFormService extends BaseService {
  /*
   * 描述：描述根据模板插入信息
   */
  save(params) {
    // return this.postAction(this.getBaseUrl() + `/form/formVisualdev/save`, params);
    return this.postEncryAction(this.getBaseUrl() + `/form/formVisualdev/save`, params);
  }
  saveBatch(params) {
    return this.postAction(this.getModulePath() + `/saveBatch`, params);
  }
  delete(params) {
    return this.postAction(this.getModulePath() + `/delete`, params);
  }
  delectById(params) {
    return this.getAction(this.getBaseUrl() + `/form/formVisualdev/deleteById`, params);
  }
  copyById(params) {
    return this.getAction(this.getBaseUrl() + `/form/formVisualdev/copyOne`, params);
  }
  queryListColumn(params) {
    return this.getAction(this.getBaseUrlOauth() + `/publics/ucDataBase/queryListColumn`, params);
  };
  deleteBatchByIds(params) {
    return this.postAction(this.getModulePath() + `/deleteBatchByIds`, params);
  }
  queryById(params) {
    return this.getAction(this.getBaseUrl() + `/form/formVisualdev/queryById`, params);
  }
  queryBatchByIds(params) {
    return this.postAction(this.getModulePath() + `/queryBatchByIds`, params);
  }
  queryPage(params) {
    return this.getAction(this.getBaseUrl() + `/form/formVisualdev/queryPage`, params);
  }
  queryDbPage(params) {
    return this.getAction(this.getBaseUrlOauth() + `/publics/ucDataBase/queryPage`, params);
  }
  queryList(params) {
    return this.getAction(this.getModulePath() + `/queryList`, params);
  }
  getTablePage(params) {
    return this.getAction(this.getBaseUrlOauth() + `/publics/ucDataBase/queryPageTable`, params);
  }
  downLoad(params){
    return this.postDownloadFile(this.getBaseUrl() + `/form/formVisualdev/downloadCode`, params);
  }
  CodePreview(params){
    return this.getAction(this.getBaseUrl() + `/form/formVisualdev/previewCode`, params);
  }
  queryApiData(params) {
    return this.postAction(`dev/devDataModelApi/queryApiData`, params);
  }
  getDictByNodeKey(params) {
    return this.getAction(`publics/dict/getDictByNodeKey`, params);
  }
  getInitMasterData(params) {
    return this.getAction(this.getBaseUrlMdm() + `/form/formView/getInitMasterData`, params);
  }
  queryResPage(params) {
    return this.getAction(this.getBaseUrlOauth() + `/publics/ucResourcesDir/queryPage`, params);
  }
  /*
  * 粘贴
  * */
  pasteById(params) {
    return this.getAction(this.getModulePath() + `/pasteById`, params);
  }
  saveForm(params) {
    return this.postAction(this.getBaseUrl() + `/form/jxjkFinancingRequest/save`, params);
  }
  queryByIdFinancing(params) {
    return this.getAction(this.getBaseUrl() + `/form/jxjkFinancingRequest/queryById`, params);
  }
  /**
   * 描述:获取host地址
   * @returns {string}
   */
  getBaseUrl() {
    return this.serviceConfig.getBaseUrl("dev");
  }
  getBaseUrlOauth() {
    return this.serviceConfig.getBaseUrl("oauth");
  }
  getBaseUrlMdm() {
    return this.serviceConfig.getBaseUrl("mdm");
  }
  /**
   * 描述:获取模块地址
   * @returns {string}
   */
  getModulePath() {
    return "/dev/devForm";
  }
}
export default new DevFormService();
